home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1989 January / 1989-01.d64 / deluxe demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  58 lines

  1. 10 rem copyright 1989 compute! publications, inc. - all rights reserved
  2. 20 ifpeek(49152)<>32anda=0thena=1:load"dinput",8,1
  3. 30 rem put line 20 at the beginning of your program
  4. 40 poke53280,11:poke53281,0:b$=chr$(13):gosub 530:print"[147][159]
  5. 50 [153][163]12)"lenopyright 1989"
  6. 60 [153][163]7)"len(NULL)(NULL)(NULL)(NULL)(NULL)val! (NULL)ublications, right$nc."
  7. 70 [153][163]10)"atnll (NULL)ights (NULL)eserved"
  8. 80 l[178]20:r[178]0:fl[178]20:bl[178]0:bx[178]255:cs[178]0
  9. 90 [153]"str$val(NULL)(NULL)(NULL)val right$(NULL)(NULL)(NULL)(NULL) can add quite a bit of"
  10. 100 [153]"spice to your programs.  right$t also allows"
  11. 110 [153]"a much better way to input data from "
  12. 120 [153]"the keyboard.  right$ts functions include:open"
  13. 130 [153]:[153]"right$. str$efining the maximum length of the"
  14. 140 [153]"    input field (ex. 5 chars.)   :";:l[178]5:[141]510
  15. 150 [153]:[153]"right$right$. (NULL)eversing the input field    :";:r[178]1:[141]510
  16. 160 [153]:[153]"right$right$right$. asclashing the cursor faster  :";:fl[178]10:[141]510
  17. 170 [153]:[153]"right$(NULL). atn bell at the end of input   :";:bl[178]1:[141]510
  18. 180 [153]:[153]"(NULL). (NULL)utting a peek(NULL)(NULL)str$val(NULL) around input:";:bx[178]1:[141]510
  19. 190 [153]"onon      (notice the border disappears!)open"
  20. 200 [153]:[153]"(NULL)right$. atnllowing-"
  21. 210 [153]"atnll lenharacters      ";:cs[178]0:bx[178]255:l[178]9:[141]510
  22. 220 [153]"(NULL)umbers (NULL)nly        ";:cs[178]1:[141]510
  23. 230 [153]"(NULL)etters (NULL)nly        ";:cs[178]2:[141]510
  24. 236 [153]"(NULL)etters & (NULL)umbers   ";:cs[178]3:[141]510
  25. 238 [153]"(NULL)hifts to (NULL)ppercase ";:cs[178]4:[141]510
  26. 240 cs[178]0:l[178]3:bx[178]4:r[178]0:fl[178]255
  27. 250 [153]:[153]"right$t also allows a prompt to be put in"
  28. 260 [153]"the field (and the cursor can be a "
  29. 270 [153]"block, too!)"
  30. 280 [153]"str$o you wish to continue? ";:a$[178]"(NULL)es":[141]520
  31. 290 [139]a$[178]"n"[176]a$[178]"(NULL)o"[167][153]"(NULL)f course you do!open"
  32. 300 [153]:[153]"right$f the length = 0, a fancy 'chr$val(NULL)' "
  33. 310 [153]"statement results....."
  34. 320 [153]:[153]"(NULL)ress (NULL)eturn...open";:bl[178]0:bx[178]255:l[178]0:r[178]0:fl[178]10:[141]510
  35. 330 [153]:[153]"str$val(NULL)(NULL)(NULL)val right$(NULL)(NULL)(NULL)(NULL)open will also allow"
  36. 340 [153]"'illegal' characters such as quotes,"
  37. 350 [153]"commas, and colons:";
  38. 360 l[178]10:bl[178]1:fl[178]5:r[178]1:a$[178][199](34)[170][199](34)[170]",,,:::":[141]520
  39. 370 [153]:[153]"(NULL)ou can also change which characters"
  40. 380 [153]"exit input..atnll the ascunction (NULL)eys will"
  41. 390 [153]"exit, but (NULL)val(NULL)(NULL)(NULL)(NULL) will not.)"
  42. 400 b$[178]"inputgotodimrunreadifletrestore":[141]530
  43. 410 fl[178]20:bx[178]3:[141]510
  44. 420 [153]"str$val(NULL)(NULL)(NULL)val right$(NULL)(NULL)(NULL)(NULL) opencan even tell which"
  45. 430 [153]"character was used to exit..."
  46. 440 [153]"(NULL)ou used lenleft$(NULL)$("[198](b$)") to exit."
  47. 450 b$[178][199](13):[141]530
  48. 460 [153]:[153]"(NULL)irtually all of these useful functions"
  49. 470 [153]"are available without (NULL)(NULL)(NULL)vals. (NULL)ou just"
  50. 480 [153]"use the simple command form:"
  51. 490 [153]:[153]"(NULL)(NULL)(NULL)49152,atn$,peek$,(NULL)imit,(NULL)(NULL)(NULL),lenur(NULL)peed,peekell, peekox,lenase"
  52. 500 [153]"open":[128]
  53. 510 a$[178]""
  54. 520 [153]"sys";:[158]49152,a$,b$,l,r,fl,bl,bx,cs:[153]"open";:[142]
  55. 530 [151]49919,[195](b$):[129]x[178]1[164][195](b$):[151]49919[170]x,[198]([202](b$,x,1))
  56. 540 [130]:[142]
  57. 550 [151]782,x:[151]781,y:[158]65520:[142]
  58.